<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>手机登陆页面</title>
    <link rel="stylesheet" href="/public/mobile/jquery-weui-build/dist/css/jquery-weui.css">
	<link rel="stylesheet" href="/public/mobile/jquery-weui-build/dist/lib/weui.css">
	<link rel="stylesheet" href="/public/mobile/jquery-weui-build/demos/css/demos.css">
	<link rel="stylesheet" href="/public/mobile/static/css/mescroll.min.css">
	<link rel="stylesheet" href="/public/mobile/static/css/cl.css">
	<script src="/public/mobile/jquery-weui-build/dist/lib/jquery-2.1.4.js"></script>
	<script src="/public/mobile/static/js/jquery.SuperSlide.2.1.js"></script>
	<script src="/public/mobile/jquery-weui-build/dist/js/jquery-weui.js"></script>
	<script src="/public/mobile/jquery-weui-build/dist/js/city-picker.js"></script>	
	<script src="/public/mobile/template/template.js"></script>	
	<!--拓展组件-->
	<script type='text/javascript' src='/public/mobile/jquery-weui-build/dist/js/swiper.js' charset='utf-8'></script>
	<script type='text/javascript' src='/public/mobile/jquery-weui-build/dist/lib/fastclick.js' charset='utf-8'></script>
	
	<script type='text/javascript' src='/public/plugins/in/in-min.js' charset='utf-8'></script>
	<script type='text/javascript' src='/public/plugins/in/in-mobile_config.js' charset='utf-8'></script>
	<script type='text/javascript' src='/public/mobile/common.js' charset='utf-8'></script>
	<script type='text/javascript' src='/public/mobile/static/js/mescroll.min.js' charset='utf-8'></script>
	<style>
		body{width:100%;height:100%;background: url("/public/mobile/static/images/login.png") no-repeat;background-size: 100%;}
		.login_wrap{margin-top: 80px;}
		.login_head{font-size: 45px;}
		.login_head{height: 30px;color: #fff;text-align: center;height: 60px;line-height: 60px;margin-bottom: 40px;}
		.login_wrap .input{display: block;width: 85%;height:35px;margin: 30px auto;border: 1px solid #fff;border-radius:12px;padding-left: 7px;background-color:transparent;font-size: 14px;color: #fff;}
		.btn-block{width: 85%;height: 35px;border-radius:12px;background-color:transparent;margin: 10px 7.5%;color: #fff;margin-top:50px;border: 1px solid #fff;box-shadow: 0px 0px 5px #fff;}
		input::-webkit-input-placeholder{color: #fff;opacity:0.5;}
		input{outline:none} 
	</style>
</head>

<body>
	<div class="login_wrap">
		<p class="login_head">welcome</p>
		<form method="post" id="loginForm" class="login-form">
            <input type="text" id="account" name="account" class="input username" placeholder="请输入帐户："/>
            <input type="password" id="password" name="password" class="input password" placeholder="请输入密码："/>
            <button type="button" class="btn-block" id="btnLogin">登录</button>
        </form>
	</div>
	
	
	
	<script type="text/javascript">
	    $(document).ready(function () {
	        $(function () {
	            $('#btnLogin').bind('click', function () {
	                doLogin();
	            });
	            document.onkeydown = function (e) {
	                var ev = document.all ? window.event : e;
	                if (ev.keyCode == 13) {
	                    doLogin();
	                }
	            }
	        });
	    });
	    //用户登录
	    function doLogin(){
	        var account = $('#account').val();
	        var password = $('#password').val();
	        if (account == '') {
	            $.alert('帐户不能为空！');
	            return false;
	        }
	        if (password == '') {
	            $.alert('密码不能为空！');
	            return false;
	        }
	        var url = "{:url('doLogin')}";
	        $.ajax({
	            type: 'post',
	            url: url,
	            data: $('#loginForm').serialize(),
	            cache: false,
	            async: false,
	            beforeSend: function (data) {
	                $.showLoading();
	            },
	            success: function (data) {
	                $.hideLoading();
	                if (data.code == 1) {
                    	$.toptip('操作成功', 'success');
                        location.href = data.url;
	                } else {
	                    $.toptip(data.msg, 'error');
	                }
	            },
	            error: function () {
	                $.hideLoading();
	                $.alert('与服务器断开连接！');
	                return false;
	            }
	        });
	    }
	</script>
</body>
</html>

